<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: CTimer类 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="../../de/dc2/class_c_timer-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">CTimer类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>timer对象，在后台运行当计时触发条件成熟后触发运行指定函数。目前不支持带 参数的通知.这个对象实现全部采用标准的库实现，可以有比较好的通用型。但是要求 编译器支持c++11.  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a>&gt;</code></p>
<div class="dynheader">
CTimer 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../da/d0a/class_c_timer__coll__graph.png" border="0" usemap="#a_c_timer_coll__map" alt="Collaboration graph"/></div>
<map name="a_c_timer_coll__map" id="a_c_timer_coll__map">
<area shape="rect" title="timer对象，在后台运行当计时触发条件成熟后触发运行指定函数。目前不支持带 参数的通知.这个对象实现全部采用标准的库实现，可以有比较好的通用型。但是要求 编译器支持c++11." alt="" coords="5,5,172,368"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a93e4d770fd09f5e1b984768620cc52bf" id="r_a93e4d770fd09f5e1b984768620cc52bf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a93e4d770fd09f5e1b984768620cc52bf">CTimer</a> ()</td></tr>
<tr class="memdesc:a93e4d770fd09f5e1b984768620cc52bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">计时器的默认初始化函数，这个初始化函数没有指定回调函数，能够响应计时时间，需要调用SetOwner 指定事件触发的动作。使用CTimer( ms , oneShot ),可以初始化计时时长，使用CTimer( fun , ms , oneShot ) 可以指定事件响应动作  <br /></td></tr>
<tr class="separator:a93e4d770fd09f5e1b984768620cc52bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a689ba0400ed26875987d51b5698e638f" id="r_a689ba0400ed26875987d51b5698e638f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a689ba0400ed26875987d51b5698e638f">CTimer</a> (long ms, bool oneShot=false)</td></tr>
<tr class="separator:a689ba0400ed26875987d51b5698e638f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4973e2b4c5c5dd14c3760bf7dfdd795" id="r_ad4973e2b4c5c5dd14c3760bf7dfdd795"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad4973e2b4c5c5dd14c3760bf7dfdd795">CTimer</a> (std::function&lt; void()&gt; fun, long ms, bool oneShot=false)</td></tr>
<tr class="separator:ad4973e2b4c5c5dd14c3760bf7dfdd795"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9482f3b89043986caeb6136df6d4fd08" id="r_a9482f3b89043986caeb6136df6d4fd08"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9482f3b89043986caeb6136df6d4fd08">~CTimer</a> ()</td></tr>
<tr class="separator:a9482f3b89043986caeb6136df6d4fd08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae550e92982e94eb1f9140212600bba2d" id="r_ae550e92982e94eb1f9140212600bba2d"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae550e92982e94eb1f9140212600bba2d">operator()</a> () const</td></tr>
<tr class="memdesc:ae550e92982e94eb1f9140212600bba2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置和获取计时器计时长度  <br /></td></tr>
<tr class="separator:ae550e92982e94eb1f9140212600bba2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad893a03dc5b05b3f1a204c0fd77658b1" id="r_ad893a03dc5b05b3f1a204c0fd77658b1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad893a03dc5b05b3f1a204c0fd77658b1">operator()</a> (long t)</td></tr>
<tr class="separator:ad893a03dc5b05b3f1a204c0fd77658b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad252c89444a7ed6eae41b09520015eda" id="r_ad252c89444a7ed6eae41b09520015eda"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad252c89444a7ed6eae41b09520015eda">Start</a> (long ms=-1, bool oneShot=false)</td></tr>
<tr class="memdesc:ad252c89444a7ed6eae41b09520015eda"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动或者重启计时器。  <br /></td></tr>
<tr class="separator:ad252c89444a7ed6eae41b09520015eda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46eb5cecd92e193d8b49f6b4454e480a" id="r_a46eb5cecd92e193d8b49f6b4454e480a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a46eb5cecd92e193d8b49f6b4454e480a">SetOwner</a> (std::function&lt; void()&gt; fun)</td></tr>
<tr class="memdesc:a46eb5cecd92e193d8b49f6b4454e480a"><td class="mdescLeft">&#160;</td><td class="mdescRight">指定事件响应函数，  <br /></td></tr>
<tr class="separator:a46eb5cecd92e193d8b49f6b4454e480a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fe9ad152f641589251afdabebd60572" id="r_a7fe9ad152f641589251afdabebd60572"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7fe9ad152f641589251afdabebd60572">Stop</a> ()</td></tr>
<tr class="memdesc:a7fe9ad152f641589251afdabebd60572"><td class="mdescLeft">&#160;</td><td class="mdescRight">停止计时器  <br /></td></tr>
<tr class="separator:a7fe9ad152f641589251afdabebd60572"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae948212119cc44200a991d76835b672c" id="r_ae948212119cc44200a991d76835b672c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae948212119cc44200a991d76835b672c">IsRuning</a> ()</td></tr>
<tr class="memdesc:ae948212119cc44200a991d76835b672c"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断计时器是否正在运行  <br /></td></tr>
<tr class="separator:ae948212119cc44200a991d76835b672c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9ce993463934cba250fa0214c07691b" id="r_aa9ce993463934cba250fa0214c07691b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa9ce993463934cba250fa0214c07691b">Reset</a> ()</td></tr>
<tr class="memdesc:aa9ce993463934cba250fa0214c07691b"><td class="mdescLeft">&#160;</td><td class="mdescRight">复位计时，让计时器从零开始计时  <br /></td></tr>
<tr class="separator:aa9ce993463934cba250fa0214c07691b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>timer对象，在后台运行当计时触发条件成熟后触发运行指定函数。目前不支持带 参数的通知.这个对象实现全部采用标准的库实现，可以有比较好的通用型。但是要求 编译器支持c++11. </p>
<dl class="section version"><dt>版本</dt><dd>0.2 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2017-2-7 </dd></dl>
<dl class="section author"><dt>作者</dt><dd>宋炜 </dd></dl>

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00023">23</a> 行定义.</p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="a93e4d770fd09f5e1b984768620cc52bf" name="a93e4d770fd09f5e1b984768620cc52bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93e4d770fd09f5e1b984768620cc52bf">&#9670;&#160;</a></span>CTimer() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CTimer::CTimer </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>计时器的默认初始化函数，这个初始化函数没有指定回调函数，能够响应计时时间，需要调用SetOwner 指定事件触发的动作。使用CTimer( ms , oneShot ),可以初始化计时时长，使用CTimer( fun , ms , oneShot ) 可以指定事件响应动作 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ms</td><td>，时长，单位为ms </td></tr>
    <tr><td class="paramname">oneShot</td><td>， 设置为true，完成一次时间响应之后，计时器停止计时，否则计时响应时间后重启计时 </td></tr>
    <tr><td class="paramname">fun，事件响应函数</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00043">43</a> 行定义.</p>

</div>
</div>
<a id="a689ba0400ed26875987d51b5698e638f" name="a689ba0400ed26875987d51b5698e638f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a689ba0400ed26875987d51b5698e638f">&#9670;&#160;</a></span>CTimer() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CTimer::CTimer </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>ms</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>oneShot</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00045">45</a> 行定义.</p>

</div>
</div>
<a id="ad4973e2b4c5c5dd14c3760bf7dfdd795" name="ad4973e2b4c5c5dd14c3760bf7dfdd795"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4973e2b4c5c5dd14c3760bf7dfdd795">&#9670;&#160;</a></span>CTimer() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CTimer::CTimer </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void()&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>ms</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>oneShot</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00048">48</a> 行定义.</p>

</div>
</div>
<a id="a9482f3b89043986caeb6136df6d4fd08" name="a9482f3b89043986caeb6136df6d4fd08"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9482f3b89043986caeb6136df6d4fd08">&#9670;&#160;</a></span>~CTimer()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual CTimer::~CTimer </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00052">52</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../db/de1/class_c_timer_a9482f3b89043986caeb6136df6d4fd08_cgraph.png" border="0" usemap="#adb/de1/class_c_timer_a9482f3b89043986caeb6136df6d4fd08_cgraph" alt=""/></div>
<map name="adb/de1/class_c_timer_a9482f3b89043986caeb6136df6d4fd08_cgraph" id="adb/de1/class_c_timer_a9482f3b89043986caeb6136df6d4fd08_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,129,32"/>
<area shape="rect" href="../../db/de1/class_c_timer.html#a7fe9ad152f641589251afdabebd60572" title="停止计时器" alt="" coords="177,5,276,32"/>
<area shape="poly" title=" " alt="" coords="129,16,161,16,161,21,129,21"/>
</map>
</div>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="ae948212119cc44200a991d76835b672c" name="ae948212119cc44200a991d76835b672c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae948212119cc44200a991d76835b672c">&#9670;&#160;</a></span>IsRuning()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CTimer::IsRuning </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>判断计时器是否正在运行 </p>

<p class="definition">在文件 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html">timer_old.cpp</a> 第 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html#l00080">80</a> 行定义.</p>

</div>
</div>
<a id="ae550e92982e94eb1f9140212600bba2d" name="ae550e92982e94eb1f9140212600bba2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae550e92982e94eb1f9140212600bba2d">&#9670;&#160;</a></span>operator()() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">long CTimer::operator() </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置和获取计时器计时长度 </p>

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00061">61</a> 行定义.</p>

</div>
</div>
<a id="ad893a03dc5b05b3f1a204c0fd77658b1" name="ad893a03dc5b05b3f1a204c0fd77658b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad893a03dc5b05b3f1a204c0fd77658b1">&#9670;&#160;</a></span>operator()() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CTimer::operator() </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>t</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00065">65</a> 行定义.</p>

</div>
</div>
<a id="aa9ce993463934cba250fa0214c07691b" name="aa9ce993463934cba250fa0214c07691b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9ce993463934cba250fa0214c07691b">&#9670;&#160;</a></span>Reset()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CTimer::Reset </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>复位计时，让计时器从零开始计时 </p>

<p class="definition">在文件 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a> 第 <a class="el" href="../../d0/de3/timer__old_8hpp_source.html#l00091">91</a> 行定义.</p>

</div>
</div>
<a id="a46eb5cecd92e193d8b49f6b4454e480a" name="a46eb5cecd92e193d8b49f6b4454e480a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46eb5cecd92e193d8b49f6b4454e480a">&#9670;&#160;</a></span>SetOwner()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CTimer::SetOwner </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void()&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>指定事件响应函数， </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun</td><td>，事件响应的函数对象，使用std::bind完成或者直接指定函数对象 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html">timer_old.cpp</a> 第 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html#l00075">75</a> 行定义.</p>

</div>
</div>
<a id="ad252c89444a7ed6eae41b09520015eda" name="ad252c89444a7ed6eae41b09520015eda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad252c89444a7ed6eae41b09520015eda">&#9670;&#160;</a></span>Start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CTimer::Start </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>ms</em></span><span class="paramdefsep"> = </span><span class="paramdefval">-1</span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>oneShot</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>启动或者重启计时器。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ms</td><td>， 计时时长，单位ms，当ms小于0的时候，使用就计时时长启动计时器 </td></tr>
    <tr><td class="paramname">oneShot</td><td>， 是否单次计时，true单次计时，否则连续计时 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html">timer_old.cpp</a> 第 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html#l00012">12</a> 行定义.</p>

</div>
</div>
<a id="a7fe9ad152f641589251afdabebd60572" name="a7fe9ad152f641589251afdabebd60572"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fe9ad152f641589251afdabebd60572">&#9670;&#160;</a></span>Stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CTimer::Stop </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>停止计时器 </p>

<p class="definition">在文件 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html">timer_old.cpp</a> 第 <a class="el" href="../../d0/dc9/timer__old_8cpp_source.html#l00007">7</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../db/de1/class_c_timer_a7fe9ad152f641589251afdabebd60572_icgraph.png" border="0" usemap="#adb/de1/class_c_timer_a7fe9ad152f641589251afdabebd60572_icgraph" alt=""/></div>
<map name="adb/de1/class_c_timer_a7fe9ad152f641589251afdabebd60572_icgraph" id="adb/de1/class_c_timer_a7fe9ad152f641589251afdabebd60572_icgraph">
<area shape="rect" title="停止计时器" alt="" coords="177,5,276,32"/>
<area shape="rect" href="../../db/de1/class_c_timer.html#a9482f3b89043986caeb6136df6d4fd08" title=" " alt="" coords="5,5,129,32"/>
<area shape="poly" title=" " alt="" coords="161,21,129,21,129,16,161,16"/>
</map>
</div>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>include/<a class="el" href="../../d0/de3/timer__old_8hpp_source.html">timer_old.hpp</a></li>
<li>src/<a class="el" href="../../d0/dc9/timer__old_8cpp_source.html">timer_old.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
